<include file="../Public/header" />
<link href="{:APPS_URL}/w3g/_static/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
  body{background-color: #f8f8f8;}
</style>
<div id="content">
    <div id="weiba" data-title="隐私设置" class="panel" data-selected="true"  data-menu="msgmenu" style="padding:0;">
        <header>
            <div id="header-buttons">
                <a href="javascript:history.go(-1);">
                    <div id="back" class="header-menu-link" data-back="false">
                    </div>
                </a>
                <div id="messageLink" class="header-menu-link"><a href="{:U('w3g/Index/msgbox')}"><i class="num"></i></a></div>
        <div id="menuLink" class="header-menu-link"></div>
            </div>
            <h1 class="hasback">
                隐私设置
            </h1>
        </header>
    <div class="set-item setH" id="">
        <form id="privacy" method="post">
        <h1>评论：设置谁可以评论我的分享</h1>
         <div class="form-set">
            <dl <eq name="user_privacy.comment_weibo" value="0">class="current"</eq> data="0">
                <dd>所有人（不包括你的黑名单用户）</dd>
            </dl>
            <dl class="<eq name="user_privacy.comment_weibo" value="1">current</eq> noborder" data="1">
                <dd>我关注的人</dd>
            </dl>
            <input type="hidden" name="comment_weibo" id="comment_weibo" value="{$user_privacy.comment_weibo}"/>
         </div>

        <h1>私信：设置谁可以给我发私信</h1>
         <div class="form-set">
            <dl <eq name="user_privacy.message" value="0">class="current"</eq> data="0">
                <dd>所有人（不包括你的黑名单用户）</dd>
            </dl>
            <dl class="<eq name="user_privacy.message" value="1">current</eq> noborder"  data="1">
                <dd>我关注的人</dd>
            </dl>
            <input type="hidden" name="message" id="message" value="{$user_privacy.message}"/>
         </div>

        <h1>空间：设置谁可以查看我的个人空间</h1>
         <div class="form-set">
            <dl <eq name="user_privacy.space" value="0">class="current"</eq> data="0">
                <dd>所有人（不包括你的黑名单用户）</dd>
            </dl>
            <dl class="<eq name="user_privacy.space" value="1">current</eq> noborder" data="1">
                <dd>我关注的人</dd>
            </dl>
            <input type="hidden" name="space" id="space" value="{$user_privacy.space}"/>
         </div>
         </form>
         <div class="setBtn"><a href="javascript:;" class="btn-big" onclick="savePrivacy()">保存</a></div>
    </div>
</div>
<script type="text/javascript">
    $('.set-item .form-set').find('dl').click(function(){
        $(this).addClass('current');
        $(this).siblings().removeClass('current');
        $(this).parents('.form-set').find('input').val($(this).attr('data'));
    });
    function savePrivacy(){
        $.ajax({
        type : 'post',
        url : U('w3g/Setting/doSavePrivacy'),
        data: $("#privacy").serialize(),
        timeout : 10000,
        dataType: 'json',
        success : function(d){
            if(d && d.status){
                location.href=U('w3g/Setting');
            }
            else{
                $.ui.showMask(d.info,true);
            }
        },
        error: function(r){
            $.ui.showMask("连接服务器失败，请重试:)",true);
        }
      });
    }
</script>
<include file="../Public/footer" />